#import "OmDestinyListVCTableViewCell.h"
#import "OmDestinyVC.h"
@interface OmDestinyListVCTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView;
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;
@property (nonatomic, strong) UIButton *sendGiftBtn;
@end
@implementation OmDestinyListVCTableViewCell
- (void)awakeFromNib {
    [super awakeFromNib];
    self.avatarImageView.fp_cornerRadius(20).fp_clipsToBounds(YES);
    self.sendGiftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.sendGiftBtn setBackgroundColor:[UIColor colorWithRed:1 green:1 blue:1 alpha:1.0]];
    self.sendGiftBtn.layer.cornerRadius = 3;
    [self.sendGiftBtn setTitle:ASLocalizedString(@"送礼") forState:UIControlStateNormal];
    [self.sendGiftBtn addTarget:self action:@selector(sendGiftTap) forControlEvents:UIControlEventTouchUpInside];
    self.sendGiftBtn.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
    [self.sendGiftBtn setTitleColor:HexadecimalColor(@"#FA5A8C") forState:UIControlStateNormal];
    [self.contentView addSubview:self.sendGiftBtn];
    [self.sendGiftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-15);
        make.size.mas_equalTo(CGSizeMake(65, 30));
        make.centerY.equalTo(self.contentView);
    }];
}
- (void)setModel:(UserApiGetUserLikeLogModel *)model {
    _model = model;
    [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar]];
    self.nickNameLabel.text = model.user_nickname;
}
- (void)setModelTypeVisitor:(UserApiMyVisitorLogModel *)modelTypeVisitor {
    _modelTypeVisitor = modelTypeVisitor;
    [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:modelTypeVisitor.avatar]];
    self.nickNameLabel.text = modelTypeVisitor.user_nickname;
}
- (void)hideSendGiftButton {
    self.sendGiftBtn.hidden = YES;
}
- (void)sendGiftTap {
    OmDestinyVC *vc = self.viewController.parentViewController;
    [vc performSelector:@selector(showSendGift)];
    vc.sendGiftView.touid = self.model.my_like_uid;
}
@end
